<template>
    <el-input-number v-model="value"
                     v-bind="$attrs"
                     :controls="controls"
                     :precision="precision"
                     :min="min" @mousewheel.prevent>

    </el-input-number>
</template>

<script setup lang="ts">
import {computed, reactive} from "vue";

const props = withDefaults(defineProps<{
    controls?: boolean,
    precision?: number,
    min?: number,
    modelValue?: string|number
}>(),{
    controls:false,
    precision:0,
    min: 0
})

const emits = defineEmits(['update:modelValue'])

const value = computed({
    get: () => {
        return Number((props.modelValue || props.modelValue===0 || props.modelValue==='0') ? props.modelValue:undefined)
    },
    set: (val) => {
        emits('update:modelValue', val)
    }
})

</script>

<style scoped>

</style>